SchoolUser.getId   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
1
import { Entity, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
2
import { School } from './School.entity';
3
import { User } from '../User/User.entity';
4
5
@Entity()
6
export class SchoolUser {
7
  @PrimaryGeneratedColumn('uuid')
8
  private id: string;
9
10
  @ManyToOne(() => School, { nullable: false, onDelete: 'CASCADE' })
11
  private school: School;
12
13
  @ManyToOne(() => User, { nullable: false, onDelete: 'CASCADE' })
14
  private user: User;
15
16
  constructor(school: School, user: User) {
17
    this.school = school;
18
    this.user = user;
19
  }
20
21
  public getId(): string {
22
    return this.id;
23
  }
24
25
  public getSchool(): School {
26
    return this.school;
27
  }
28
29
  public getUser(): User {
30
    return this.user;
31
  }
32
}
33